let total = 3
const groups = [
]

for (let i = 0; i < total; i++) {
  groups.push({
    groupNo: i + 1,
    words: [
      {
        wordId: i + 1,
        en: `apple${i + 1}`,
        ch: `苹果${i + 1}`,
        posCh: `n. 苹果${i + 1}`,
        audio: 'https://olading.izhaoxm.cn/static/audio/raining.wav',
      },
    ],
  })
}

export default function () {
  return new Promise((resolve) => {
    setTimeout(() => {
    //   index += 1
      const result = {
        code: 0,
        message: 'success',
        data: {
          studentId: Math.random(),
          courseId: Math.random(),
          studyRecordId: null,
          //   studyRecordId: Math.random(),
          currentGroupNo: 0,
          unitNo: Math.random(),
          groups,
          //   groups:[]
        },
      }
      //   if (index > 2) {
      //     result.data.groups = []
      //   }
      resolve(result)
    }, 1000)
  })
}
